<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" template="/template/template.xhtml"
	xmlns:s="http://sduept.security.el/func">
	<ui:define name="head">
		<link rel="stylesheet" href="/resources/plugins/datatables/dataTables.bootstrap.css" />
		<style>
.ui-datatable-scrollable-header-box {
	margin-left: 0px;
	margin-right: 15px !important;
}
</style>
	</ui:define>
	<ui:define name="content">
		<p:confirmDialog global="true" showEffect="fade" hideEffect="fade">
			<p:commandButton value="是" type="button" styleClass="ui-confirmdialog-yes" icon="ui-icon-check" />
			<p:commandButton value="否" type="button" styleClass="ui-confirmdialog-no" icon="ui-icon-close" />
		</p:confirmDialog>
		<div id="headDiv" class="box box-solid with-border">
			<h:form id="headForm">
				<p:growl id="msgs" showDetail="true" />
				<div class="box-header" id="queryDiv">
					<p:outputLabel for="startTime" value="发布时间：" />
					<p:calendar id="startTime" navigator="true" value="#{weatherAllertController.start}"
						pattern="yyyy-MM-dd" maxdate="Date()">
					</p:calendar>
					<p:outputLabel for="endTime" value="至 " style="margin-right:5px;margin-left:5px;" />
					<p:calendar id="endTime" navigator="true" value="#{weatherAllertController.end}"
						pattern="yyyy-MM-dd" maxdate="Date()">
					</p:calendar>
					<p:commandButton icon="ui-icon-search" value="查询" update="form:dataTb"
						actionListener="#{weatherAllertController.query}" style="margin-left:5px;"
						oncomplete="getTableScrollHeight();">
					</p:commandButton>
				</div>
			</h:form>
		</div>
		<div id="infoDiv" class="box box-solid with-border">
			<h:form id="form">
				<p:dataTable id="dataTb" var="item" value="#{weatherAllertController.model}" rowKey="#{item.id}"
					emptyMessage="无记录" rows="20" paginator="true" rowIndexVar="ite"
					paginatorTemplate="{Customization} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} 
								{RowsPerPageDropdown}"
					rowsPerPageTemplate="20,50,100" paginatorPosition="bottom" lazy="true" scrollable="true">
					<f:facet name="{Customization}">
						<p:outputLabel value="总计：#{weatherAllertController.countRow} 条记录" style="margin-right:20px;"></p:outputLabel>
					</f:facet>
					<p:column style="width:3%" headerText="序号 ">
						<h:outputText value="#{ite+1}" />
					</p:column>
					<p:column style="width:20%" headerText="标题">
						<h:outputText value="#{item.title}" />
					</p:column>
					<p:column style="width:7%" headerText="类型">
						<h:outputText value="#{item.atype}" />
					</p:column>
					<p:column style="width:7%" headerText="等级">
						<h:outputText value="#{item.alevel}" />
					</p:column>
					<p:column style="width:33%" headerText="预警内容">
						<h:outputText value="#{item.des}" />
					</p:column>
					<p:column style="width:15%" headerText="发布时间">
						<h:outputText value="#{item.pubdate}">
							<f:convertDateTime pattern="yyyy-MM-dd HH:mm:ss" />
						</h:outputText>
					</p:column>
					<p:column style="width:15%" headerText="更新时间">
						<h:outputText value="#{item.storageTime}">
							<f:convertDateTime pattern="yyyy-MM-dd HH:mm:ss" />
						</h:outputText>
					</p:column>
				</p:dataTable>
			</h:form>
		</div>
	</ui:define>
	<ui:define name="contentend">
		<script src="/resources/js/tables/singleScrollTable.js" />
		<script src="/resources/plugins/datatables/jquery.dataTables.js"></script>
		<script src="/resources/plugins/datatables/dataTables.bootstrap.min.js"></script>
		<script src="/resources/js/tables/mytable.js"></script>
	</ui:define>
</ui:composition>
